package com.wuxiaofan.order.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wuxiaofan.order.entity.OrderReturnApply;
import com.wuxiaofan.order.entity.custom.OrderReturnApplyCustom;
import com.wuxiaofan.order.mapper.OrderReturnApplyMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wuxiaofan.order.client.Idgenerator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;

@Service
public class OrderReturnApplyService {
    @Autowired
    private OrderReturnApplyMapper omsOrderReturnApplyMapper;
    @Resource
    private Idgenerator idgenerator;
    public OrderReturnApply findById(String id){
        return omsOrderReturnApplyMapper.selectById(id);
    }

    public OrderReturnApplyCustom findCountByMap(Map paraMap){
        return omsOrderReturnApplyMapper.findCountByMap(paraMap);
    }

    public OrderReturnApplyCustom findGroupByMap(Map paraMap){
        return omsOrderReturnApplyMapper.findGroupByMap(paraMap);
    }

    public List<OrderReturnApplyCustom> findByMap(Map paraMap){
        return omsOrderReturnApplyMapper.findByMap(paraMap);
    }

    public Page<OrderReturnApplyCustom> findByMap(Map paraMap, Page page){
        return page.setRecords(omsOrderReturnApplyMapper.findByMap(paraMap,page));
    }


    public void updateMapById(Map paraMap){
        omsOrderReturnApplyMapper.updateMapById(paraMap);
    }
    public void delById(String id){
        omsOrderReturnApplyMapper.deleteById(id);
    }

    public OrderReturnApply save(OrderReturnApply omsOrderReturnApply){
        omsOrderReturnApply.setId(idgenerator.getId());
        omsOrderReturnApplyMapper.insert(omsOrderReturnApply);
        return omsOrderReturnApply;
    }

}
